home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / ColorSync 2.6 Mac SDK / Interfaces / CMCalibrator.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-07  |  6.1 KB  |  168 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMCalibrator.h
  3.  
  4.      Contains:    ColorSync Calibration API
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    ColorSync 2.6 SDK for use with Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMCALIBRATOR__
  18. #define __CMCALIBRATOR__
  19.  
  20. #ifndef __CMAPPLICATION__
  21. #include <CMApplication.h>
  22. #endif
  23. #ifndef __DISPLAYS__
  24. #include <Displays.h>
  25. #endif
  26. #ifndef __ERRORS__
  27. #include <Errors.h>
  28. #endif
  29.  
  30.  
  31.  
  32. #if PRAGMA_ONCE
  33. #pragma once
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43.  
  44. #if PRAGMA_STRUCT_ALIGN
  45.     #pragma options align=mac68k
  46. #elif PRAGMA_STRUCT_PACKPUSH
  47.     #pragma pack(push, 2)
  48. #elif PRAGMA_STRUCT_PACK
  49.     #pragma pack(2)
  50. #endif
  51.  
  52. typedef CALLBACK_API( void , CalibrateEventProcPtr )(EventRecord *event);
  53. typedef STACK_UPP_TYPE(CalibrateEventProcPtr)                     CalibrateEventUPP;
  54.  
  55. /* Interface for new ColorSync monitor calibrators (ColorSync 2.6 and greater) */
  56.  
  57.  
  58. enum {
  59.     kCalibratorNamePrefix        = FOUR_CHAR_CODE('cali')
  60. };
  61.  
  62.  
  63. struct CalibratorInfo {
  64.     UInt32                             dataSize;                    /* Size of this structure - compatibility */
  65.     AVIDType                         displayID;                    /* Contains an hDC on Win32 */
  66.     UInt32                             profileLocationSize;        /* Max size for returned profile location */
  67.     CMProfileLocation *                profileLocationPtr;            /* For returning the profile */
  68.     CalibrateEventUPP                 eventProc;                    /* Ignored on Win32 */
  69.     Boolean                         isGood;                        /* true or false */
  70. };
  71. typedef struct CalibratorInfo            CalibratorInfo;
  72. typedef CALLBACK_API( Boolean , CanCalibrateProcPtr )(AVIDType displayID, Str255 errMessage);
  73. typedef CALLBACK_API( OSErr , CalibrateProcPtr )(CalibratorInfo *theInfo);
  74. typedef STACK_UPP_TYPE(CanCalibrateProcPtr)                     CanCalibrateUPP;
  75. typedef STACK_UPP_TYPE(CalibrateProcPtr)                         CalibrateUPP;
  76. enum { uppCalibrateEventProcInfo = 0x000000C0 };                 /* pascal no_return_value Func(4_bytes) */
  77. enum { uppCanCalibrateProcInfo = 0x000003D0 };                     /* pascal 1_byte Func(4_bytes, 4_bytes) */
  78. enum { uppCalibrateProcInfo = 0x000000E0 };                     /* pascal 2_bytes Func(4_bytes) */
  79. #if MIXEDMODE_CALLS_ARE_FUNCTIONS
  80. EXTERN_API(CalibrateEventUPP)
  81. NewCalibrateEventProc           (CalibrateEventProcPtr    userRoutine);
  82. EXTERN_API(CanCalibrateUPP)
  83. NewCanCalibrateProc               (CanCalibrateProcPtr        userRoutine);
  84. EXTERN_API(CalibrateUPP)
  85. NewCalibrateProc               (CalibrateProcPtr        userRoutine);
  86. EXTERN_API(void)
  87. CallCalibrateEventProc           (CalibrateEventUPP        userRoutine,
  88.                                 EventRecord *            event);
  89. EXTERN_API(Boolean)
  90. CallCanCalibrateProc           (CanCalibrateUPP            userRoutine,
  91.                                 AVIDType                displayID,
  92.                                 Str255*                    errMessage);
  93. EXTERN_API(OSErr)
  94. CallCalibrateProc               (CalibrateUPP            userRoutine,
  95.                                 CalibratorInfo *        theInfo);
  96. #else
  97. #define NewCalibrateEventProc(userRoutine)                         (CalibrateEventUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCalibrateEventProcInfo, GetCurrentArchitecture())
  98. #define NewCanCalibrateProc(userRoutine)                         (CanCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCanCalibrateProcInfo, GetCurrentArchitecture())
  99. #define NewCalibrateProc(userRoutine)                             (CalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCalibrateProcInfo, GetCurrentArchitecture())
  100. #define CallCalibrateEventProc(userRoutine, event)                 CALL_ONE_PARAMETER_UPP((userRoutine), uppCalibrateEventProcInfo, (event))
  101. #define CallCanCalibrateProc(userRoutine, displayID, errMessage)  CALL_TWO_PARAMETER_UPP((userRoutine), uppCanCalibrateProcInfo, (displayID), (errMessage))
  102. #define CallCalibrateProc(userRoutine, theInfo)                 CALL_ONE_PARAMETER_UPP((userRoutine), uppCalibrateProcInfo, (theInfo))
  103. #endif
  104. #if OLDROUTINENAMES
  105. /* Interface for original ColorSync monitor calibrators (ColorSync 2.5.x) */
  106.  
  107. enum {
  108.     kOldCalibratorNamePrefix    = FOUR_CHAR_CODE('Cali')
  109. };
  110.  
  111.  
  112. struct OldCalibratorInfo {
  113.     AVIDType                         displayID;                    /* Contains an hDC on Win32 */
  114.     CMProfileLocation                 profileLocation;
  115.     CalibrateEventUPP                 eventProc;                    /* Ignored on Win32 */
  116.     UInt32                             reserved;                    /* Unused */
  117.     UInt32                             flags;                        /* Unused */
  118.     Boolean                         isGood;                        /* true or false */
  119.     SInt8                             byteFiller;                    /* Unused */
  120. };
  121. typedef struct OldCalibratorInfo        OldCalibratorInfo;
  122. typedef CALLBACK_API( Boolean , OldCanCalibrateProcPtr )(AVIDType displayID);
  123. typedef CALLBACK_API( OSErr , OldCalibrateProcPtr )(OldCalibratorInfo *theInfo);
  124. typedef STACK_UPP_TYPE(OldCanCalibrateProcPtr)                     OldCanCalibrateUPP;
  125. typedef STACK_UPP_TYPE(OldCalibrateProcPtr)                     OldCalibrateUPP;
  126. enum { uppOldCanCalibrateProcInfo = 0x000000D0 };                 /* pascal 1_byte Func(4_bytes) */
  127. enum { uppOldCalibrateProcInfo = 0x000000E0 };                     /* pascal 2_bytes Func(4_bytes) */
  128. #if MIXEDMODE_CALLS_ARE_FUNCTIONS
  129. EXTERN_API(OldCanCalibrateUPP)
  130. NewOldCanCalibrateProc           (OldCanCalibrateProcPtr    userRoutine);
  131. EXTERN_API(OldCalibrateUPP)
  132. NewOldCalibrateProc               (OldCalibrateProcPtr        userRoutine);
  133. EXTERN_API(Boolean)
  134. CallOldCanCalibrateProc           (OldCanCalibrateUPP        userRoutine,
  135.                                 AVIDType                displayID);
  136. EXTERN_API(OSErr)
  137. CallOldCalibrateProc           (OldCalibrateUPP            userRoutine,
  138.                                 OldCalibratorInfo *        theInfo);
  139. #else
  140. #define NewOldCanCalibrateProc(userRoutine)                     (OldCanCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOldCanCalibrateProcInfo, GetCurrentArchitecture())
  141. #define NewOldCalibrateProc(userRoutine)                         (OldCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOldCalibrateProcInfo, GetCurrentArchitecture())
  142. #define CallOldCanCalibrateProc(userRoutine, displayID)         CALL_ONE_PARAMETER_UPP((userRoutine), uppOldCanCalibrateProcInfo, (displayID))
  143. #define CallOldCalibrateProc(userRoutine, theInfo)                 CALL_ONE_PARAMETER_UPP((userRoutine), uppOldCalibrateProcInfo, (theInfo))
  144. #endif
  145. #endif  /* OLDROUTINENAMES */
  146.  
  147.  
  148. #if PRAGMA_STRUCT_ALIGN
  149.     #pragma options align=reset
  150. #elif PRAGMA_STRUCT_PACKPUSH
  151.     #pragma pack(pop)
  152. #elif PRAGMA_STRUCT_PACK
  153.     #pragma pack()
  154. #endif
  155.  
  156. #ifdef PRAGMA_IMPORT_OFF
  157. #pragma import off
  158. #elif PRAGMA_IMPORT
  159. #pragma import reset
  160. #endif
  161.  
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165.  
  166. #endif /* __CMCALIBRATOR__ */
  167.  
  168.